package testes;


import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;

import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.LinkedList;

import org.junit.Test;

import cflow.Cflow;

import junit.*;
import logical.AutomataGenerator;
import logical.SimpleNode;

public class teste {

	public boolean resultados(String regex,  LinkedList<String> input)
	{
		regex=regex+'\n';
		new Cflow(regex);
		for (String values :input)
		Cflow.addTransition(values);
		if(Cflow.getAcceptedTrace().size()!=input.size())
			return false;
		for (int i=0;i<input.size();i++)
		{
			if(!input.get(i).equals(Cflow.getAcceptedTrace().get(i)))
				return false;
		}
		return true;
		
	}

	@Test
	public void test1()
	{
		 LinkedList<String> input=new LinkedList<String>();
		 input.add("a");
		 input.add("b");
		 boolean res=resultados("a+b", input);
		 assertEquals(true,res);
	}
	
	@Test
	public void test2()
	{
			
		 LinkedList<String> input=new LinkedList<String>();
		 input.add("a");
		 boolean res=resultados("a+", input);
		 assertEquals(true,res);
	}
	

	

}
